package minigame;

import java.io.*;
import java.net.URL;
import javax.sound.sampled.*;
import javax.swing.*;
import java.util.logging.Level;
import java.util.logging.Logger;

public class sound extends JFrame {

	public sound(String file) {

		try {
			URL url = this.getClass().getResource(file);
			AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);
			Clip clip = AudioSystem.getClip();
			clip.open(audioIn);
			if (!clip.isRunning()) {
				clip.setFramePosition(0);
				clip.start();
			}
		} catch (UnsupportedAudioFileException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} catch (LineUnavailableException e) {
			e.printStackTrace();
		}
	}

}